package com.aaa.service.back;

import com.aaa.entity.Purchase;
import com.aaa.entity.PurchaseDetails;

import java.util.List;
import java.util.Map;

public interface PurchaseService {
    /**
     * 查询未审核的采购订单
     * @return
     */
    List<Map<String,Object>> findPurchaseByPurchaseState1();

    /**
     * 根据采购订单编号查询
     * @param purchaseId
     * @return
     */
    Purchase findByPurchaseId(String purchaseId);

    /**
     * 查询已审核/未入库的采购订单
     * @return
     */
    List<Map<String,Object>> findPurchaseByPurchaseState0(Integer purchaseState);

    /**
     * 查询已入库的采购订单
     * @return
     */
    List<Map<String,Object>> findPurchaseByPurchaseState2(Integer purchaseState);

    /**
     * 修改采购订单未入库状态为已入库
     * @param purchaseId
     * @return
     */
    int editPurchase0(String purchaseId);

    /**
     * 根据采购订单编号查询采购订单明细
     * @return
     */
    List<Map<String,Object>> findPurchaseDetails(String purchaseId);

    /**
     * 根据采购订单编号查询采购订单明细
     * @param purchaseId
     * @return
     */
    List<PurchaseDetails> findByPurchaseDetails(String purchaseId);

    /**
     * 创建采购订单
     * @param purchase
     * @return
     */
    int addPurchase(Purchase purchase);

    /**
     * 添加采购明细
     * @return
     */
    int addPurchaseDetails(PurchaseDetails purchaseDetails);

    /**
     * 审核订单，修改采购订单状态
     * @return
     */
    int editPurchase(Purchase purchase);

    String findPurchaseByMAX();
}
